package squareBorderPackage;

import static org.junit.Assert.*;

import java.math.BigDecimal;

import org.junit.*;

import temperaturePackage.*;

/**
 * A class collecting tests for the class of normalSquares.
 * 
 * @version 2.0
 * @author Esther Alberts & Jessa Bekker
 */
public class NormalSquareTest {
	
	@Test
	public void initializeObject_Legal() {
		Square square = new NormalSquare(new Temperature(100, TemperatureUnit.CELSIUS),
				new BigDecimal(30), Direction.SOUTH, Direction.WEST);
		assertTrue(square.getTemperature().equals(new Temperature(100, TemperatureUnit.CELSIUS)));
		assertTrue(square.getHumidity().equals(new BigDecimal(30).setScale(2, BigDecimal.ROUND_HALF_UP)));
		assertTrue(square.getBorderAt(Direction.NORTH) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.EAST) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.SOUTH) instanceof Wall);
		assertTrue(square.getBorderAt(Direction.WEST) instanceof Wall);
		assertTrue(square.getBorderAt(Direction.CEILING) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.FLOOR) instanceof OpenBorder);
		assertTrue(square.getSpace().contains(square));
	}
	
	@Test
	public void initializeObject_defaultLegal() {
		Square square = new NormalSquare();
		assertTrue(square.getTemperature().equals(new Temperature(25, TemperatureUnit.CELSIUS)));
		assertTrue(square.getHumidity().equals(new BigDecimal(25).setScale(2, BigDecimal.ROUND_HALF_UP)));
		assertTrue(square.getBorderAt(Direction.NORTH) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.EAST) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.SOUTH) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.WEST) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.CEILING) instanceof OpenBorder);
		assertTrue(square.getBorderAt(Direction.FLOOR) instanceof Wall);
		assertTrue(square.getSpace().contains(square));
	}
}
